
// 基于template/src/views/{{appModules}}/{{pages@DEEDITVIEW4}}/{{spinalCase page.codeName}}-hook.ts.hbs生成
import { QXEvent } from 'qx-util';
import {
	EditView4ActionType,
	EditView4Controller,
	IEditView4Ability,
	IEditView4ControllerParams,
	IParam,
	IViewEvent,
} from '@/core';
import {
	useEditView4Props,
	useEditView4Basic,
	useEditView4ControllerParams,
    useEditView4Action,
} from '@/hooks/view/use-edit4-view';
import { model } from "./ibizbook-edit-view-4-model";

/**
 * 获取输入参数
 *
 * @export
 * @return {*}
 */
export function useProps() {
	return {
		...useEditView4Props()
	};
}

/**
 * 获取基础数据
 *
 * @export
 * @param {*} props
 * @return {*}
 */
export function useBasic(props: any) {
	return {
		...useEditView4Basic(model, props)
	};
}

/**
 * 获取行为
 *
 * @export
 */
export function useAction(controller: any) {
	return {
        ...useEditView4Action(controller)
    }
}

/**
 * 获取控制器
 *
 * @export
 * @param {IParam} props
 * @param {QXEvent<IViewEvent<EditView4ActionType, IEditView4Ability>>} evt
 * @return {*}
 */
export function useController(
	props: IParam,
	evt: QXEvent<IViewEvent<EditView4ActionType, IEditView4Ability>>
) {
	const params: IEditView4ControllerParams<
		EditView4ActionType,
		IEditView4Ability
	> = useEditView4ControllerParams(model, props, evt);
	return new EditView4Controller(params);
}